package com.msh.artascope.devcloud.client.qo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.msh.artascope.interfaces.ILoginAccount;
import com.msh.frame.client.base.BaseProperties;
import java.util.Date;
import com.msh.frame.client.base.BaseQo;
import com.msh.frame.client.validation.*;

import io.swagger.v3.oas.annotations.media.Schema;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Null;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;

/**
 * @author shihu
 * @mail m-sh@qq.com
 */
@Data
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Schema(name = "环境信息Qo")
public class EnvQo extends BaseQo<EnvQo> {
  @Schema(name = "主键id")
  private Long id;

  @Schema(name = "环境")
  private String env;

  @Schema(name = "命名空间")
  private String namespace;

  @Schema(name = "租户")
  private Long tenantId;

  @Min(groups = {IListVo.class}, value = 1, message = "currentPage从1开始")
  @Schema(name = "当前页数")
  protected Integer currentPage = 1;

  @Min(groups = {IListVo.class}, value = 1, message = "pageSize最少返回1条")
  @Max(groups = {IListVo.class}, value = 10000, message = "pageSize最多返回10000条")
  @Schema(name = "每页返回数量")
  protected Integer pageSize = BaseProperties.MAX_PAGE_SIZE;

  public void initLoginAccount(ILoginAccount loginAccount){
    this.tenantId = loginAccount.getTenantId();
  }


}